<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>好日子物流园库房管理系统</title>
    <meta name="keywords" content="好日子物流园库房管理系统">
    <meta name="description" content="好日子物流园库房管理系统">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    <link href="/css/login.css" rel="stylesheet">
    <link href="/css/style_login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
<!--<div class="signinpanel">-->
    <!--<div class="row">-->
        <!--<div class="col-sm-7">-->
            <!--<div class="signin-info">-->
                <!--<div class="logopanel m-b">-->
                    <!--<h1>SpeedMaterial</h1>-->
                <!--</div>-->
                <!--<div class="m-b"></div>-->
                <!--<h3>-->
                    <!--欢迎使用 <strong>物联速通后台管理系统</strong>-->
                <!--</h3>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="col-sm-5">-->
            <!--<form id="signupForm">-->
                <!--<h3 class="text-center">用户登录</h3>-->
                <!--<p class="m-t-md text-center">欢迎登录后台管理系统</p>-->
                <!--<input type="text" name="username" class="form-control uname"-->
                       <!--value=""/>-->
                <!--<input type="password" name="password"-->
                       <!--class="form-control pword m-b" value=""/>-->
                <!--<a id="login" class="btn btn-login btn-block">登录</a>-->
                <!--&lt;!&ndash;按钮模块&ndash;&gt;-->
            <!--</form>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="signup-footer">-->
        <!--&lt;!&ndash;<div class="pull-left">&copy; 2017 All Rights Reserved. BootDo&ndash;&gt;-->
        <!--</div>-->
    <!--</div>-->
<!--</div>-->


<img alt="full screen background image" src="img/bg.jpg" class="full-screen-background">


<div class="coming-soon-content">
    <h3><img alt="logo.png" src="img/hrzLogo.png" style="width:150px;border-radius:18px;box-shadow:yellow 6px 6px 18px 5px;margin-bottom:30px;">

        <div style="color:#910808;  font-family: Helvetica Neue,Helvetica,Arial,Microsoft Yahei;Hiragino Sans GB;Heiti SC;WenQuanYi Micro Hei,sans-serif;  text-shadow:5px 2px  5px #ffffff;font-weight: bold;">好日子物流园库房管理系统</div>
    </h3>


    <div class=" center-block container" style=" color:#fff;">
        <div class=" ">
            <div class="col-lg-4 col-lg-offset-4 col-sm-10 col-md-6 col-md-offset-3 col-sm-offset-1 col-xs-10 col-xs-offset-1">
                <form class="form-4"  id="signupForm">

                    <input name="flag" value="admin" type="hidden">

                    <div class="input-group input-group-lg">
                        <span class="input-group-addon" id="sizing-addon1"><i class="icon icon-user"></i></span>
                        <input class="form-control" placeholder="用户名" style="color:#333;" aria-describedby="sizing-addon1" id="username" name="username" type="text">
                    </div>

                    <div class="input-group input-group-lg mt18">
                        <span class="input-group-addon" id="sizing-addon2"><i class="icon icon-key"></i></span>
                        <input name="password" id="password" value="" style="color:#333;" class="form-control" placeholder="密码" aria-describedby="sizing-addon1" type="password">
                    </div>

                    <div class="input-group mt18 text-center " style="width:100%;">

                        <button type="submit" id="login" value="login" class="btn btn-warning btn-lg   ">登录系统</button>


                    </div>


                </form>
            </div>

        </div>
    </div>
</div>




<script th:inline="javascript"> var ctx = [[@{/}]] ; </script>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4" th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
<script src="/js/bootstrap.min.js?v=3.3.6" th:src="@{/js/bootstrap.min.js?v=3.3.6}"></script>

<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0" th:src="@{/js/content.js?v=1.0.0}"></script>

<!-- jQuery Validation plugin javascript-->
<script src="/js/ajax-util.js"></script>
<script src="/js/plugins/validate/jquery.validate.min.js" th:src="@{/js/plugins/validate/jquery.validate.min.js}"></script>
<script src="/js/plugins/validate/messages_zh.min.js" th:src="@{/js/plugins/validate/messages_zh.min.js}"></script>
<script src="/js/plugins/layer/layer.min.js" th:src="@{/js/plugins/layer/layer.min.js}"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#login").on('click',function(){

            $("#signupForm").submit();
        });

        validateRule();
    });

    $.validator.setDefaults({
        submitHandler: function () {
            //alert("qqqqqqq")
            login();

        }
    });

    function login() {
        $.ajax({
            type: "POST",
            url: ctx+"login",
            data: $('#signupForm').serialize(),
            success: function (r) {
                 if (r.code == 0) {
                    var index = layer.load(1, {
                        shade: [0.1,'#fff'] //0.1透明度的白色背景
                    });
                    parent.location.href = '/index';
                } else {
                    layer.msg(r.msg);
                }
            },
        });
    }

    function validateRule() {
        var icon = "<i class='fa fa-times-circle'></i> ";
        $("#signupForm").validate({
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true
                }
            },
            messages: {
                username: {
                    required: icon + "请输入您的用户名",
                },
                password: {
                    required: icon + "请输入您的密码",
                }
            }
        })
    }
</script>
</body>
</html>
